package com.bestcem.xm.member.util;

import com.bestcem.xm.common.core.domain.web.ServiceResult;
import com.bestcem.xm.member.grpc.client.XmMemberClient;
import com.bestcem.xm.member.service.dto.OrganizationDTO;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * python grpc 公共方法
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/8/25
 */
@Component
public class RpcClientUtil {

    @Resource
    protected XmMemberClient xmMemberClient;

    /**
     * 获取组织信息
     *
     * @param orgId
     */
    public ServiceResult<OrganizationDTO> getOrganization(String orgId) {
        return xmMemberClient.getOrgByIdOrCode(orgId, null);
    }

}
